/**
 * @brief   梁截面属性计算类
 *
 * @author   Liu Xing
 * @date     2025.10.27
 * @copyright Copyright (c)   ShenGong  Simulation corporation
 */

#pragma once
#include <Eigen/Sparse>

#include "Utility/Algebra/Matrix.h"

#include "DataStructure/Common/Out.h"
#include "DataStructure/Common/SGNamespace.h"
#include "DataStructure/Input/Property/BeamMeshedSectionProperty.h"

#include "../../Common/BeamSecPropCalculatorExport.h"
#include "SectionElement/ISectionElement.h"
#include "SectionMesh.h"

SG_NAMESPACE_OPEN
namespace FEMSolver
{
    namespace Element
    {
        class BeamSecPropCalculator_DECLSPEC SectionCalculator
        {
          public:
            /**
             * @brief 计算截面属性的接口方法，里面封装了下面两个计算截面属性的私有方法
             *
             */
            static void Calculate (Meshes& meshes, _OUT SG::DataStructure::FEM::BeamMeshedSectionProperty& sectionProperty);

          private:
            /**
             * @brief    计算截面翘曲无关属性: 面积 惯性矩 形心坐标
             *
             * @param    meshes             网格
             * @param    sectionProperty    截面属性
             */
            static void CalculateNonwarpPop (const Meshes& meshes, _OUT SG::DataStructure::FEM::BeamMeshedSectionProperty& sectionProperty);

            /**
             * @brief    计算截面翘曲相关属性: 扭转常数 剪切系数 剪心坐标
             *           该方法传入的网格坐标应是形心轴坐标系！
             * @param    meshes
             * @param    sectionProperty
             */
            static void CalculateWarpPop (const Meshes& meshes, _OUT SG::DataStructure::FEM::BeamMeshedSectionProperty& sectionProperty);
        };
    };  // namespace Element
};  // end namespace FEMSolver
SG_NAMESPACE_CLOSE